package com.fenqiyong.www;

import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.fenqiyong.www.action.ALoginActContract;
import com.fenqiyong.www.action.ALoginActPresent;

import javax.inject.Inject;

import ren.nearby.http.base.BaseActivity;
import ren.nearby.http.utils.util.ToastUtils;

/**
 * Created by lr on 2019/3/16.
 */

public class ALoginAct extends BaseActivity implements ALoginActContract.View {

    EditText etmobile;
    Button btn;
    @Inject
    ALoginActContract.Action action;

    @Override
    public int getContentView() {
        return R.layout.a_login;
    }

    @Override
    public void initView() {
        etmobile = findViewById(R.id.mobile);
        btn = findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String mobile = etmobile.getText().toString().trim();
                if (TextUtils.isEmpty(mobile)) {
                    ToastUtils.showToast(getApplicationContext(), "请输入手机号");
                    return;
                }
                action.smsSend(mobile);
            }
        });
    }

    @Override
    public void onIntent() {
        action.takeView(this);
    }

    @Override
    public void setPresenter(ALoginActPresent presenter) {

    }

    @Override
    public void startCode() {

    }

    @Override
    public void startLock() {

    }

    @Override
    public void stopCode() {

    }
}
